import static org.junit.Assert.*;

import org.junit.Test;

import com.hamishmedlin.d64pw.QUtils;


public class QUtilsTests {
	
	@Test
	public void testIntDivide() {
		int first = 3192;
		int second = 400;		
		int result = QUtils.intDivide(first, second);
		assertEquals(7,result);
	}
	
	@Test
	public void testIntMod() {
		int first = 3192;
		int second = 400;		
		int result = QUtils.intMod(first, second);
		assertEquals(392,result);
	}
	
	@Test
	public void testMakeBE16() {
		int first = 4;
		int second = 255;		
		int result = QUtils.makeBE16(first,second);
		assertEquals(1279,result);
	}
	
	@Test
	public void testUnmakeBE16() {
		int first = 56041;		
		int[] result = QUtils.unmakeBE16(first);
		assertEquals(233,result[0]);
		assertEquals(218,result[1]);
	}
	
	@Test
	public void testByteSwap() {
		int first = -71206;		
		int result = QUtils.byteSwap(first);
		assertEquals(56041,result);
	}
	
	@Test
	public void testIntDivide2() {
		System.out.println(QUtils.intDivide(4, 5));
	}
}
